home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / eoshift.z / eoshift
Encoding:
Text File  |  1998-10-30  |  5.8 KB  |  137 lines

  1. EOSHIFT(3I)                                            Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      EEOOSSHHIIFFTT - Performs an end-off shift on an array expression
  6.  
  7. SSYYNNOOPPSSIISS
  8.      EEOOSSHHIIFFTT (([AARRRRAAYY==]_a_r_r_a_y,, [SSHHIIFFTT==]_s_h_i_f_t [,,[BBOOUUNNDDAARRYY==]_b_o_u_n_d_a_r_y]
  9.      [,,[DDIIMM==]_d_i_m]))
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, and IRIX systems
  13.  
  14. SSTTAANNDDAARRDDSS
  15.      Fortran 90
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      The EEOOSSHHIIFFTT intrinsic function performs an end-off shift on an array
  19.      expression of rank one, or it performs end-off shifts on all the
  20.      complete rank one sections along a given array expression of rank two
  21.      or greater.  Elements are shifted off at one end of a section and
  22.      copies of a boundary value are shifted in at the other end.  Different
  23.      sections can have different boundary values and can be shifted by
  24.      different amounts and in different directions; positive for left
  25.      shifts, negative for right shifts.
  26.  
  27.      EEOOSSHHIIFFTT accepts the following arguments:
  28.  
  29.      _a_r_r_a_y     May be of any type.  It must not be scalar.
  30.  
  31.      _s_h_i_f_t     Must be integer.  If _a_r_r_a_y has rank one, _s_h_i_f_t must be a
  32.                scalar.  Otherwise, _s_h_i_f_t must be scalar or have rank _n-1
  33.                and have
  34.                shape (_d , _d , ..., _d     , _d     , ..., _d ),
  35.                        1   2        _d_i_m-1   _d_i_m+1        _n
  36.                where (_d , _d , ..., _d )
  37.                        1   2        n
  38.                is the shape of _a_r_r_a_y.
  39.  
  40.      _b_o_u_n_d_a_r_y  Must be of the same type and have the same type parameters
  41.                as _a_r_r_a_y.  Must be scalar if _a_r_r_a_y has rank one; otherwise,
  42.                it must be either scalar or of rank _n-1 and of
  43.                shape (_d , _d , ..., _d     , _d     , ..., _d ),
  44.                        1   2        _d_i_m-1   _d_i_m+1        _n
  45.                The _b_o_u_n_d_a_r_y argument can be omitted for the data types in
  46.                the following list.  In these cases, the default value is
  47.                the scalar value shown:
  48.  
  49.                TTyyppee ooff _a_r_r_a_y       DDeeffaauulltt VVaalluuee ooff _b_o_u_n_d_a_r_y
  50.  
  51.                Integer             0
  52.  
  53.                Real                0.0
  54.  
  55.                Complex             (0.0,0.0)
  56.  
  57.                Logical             false
  58.  
  59.                Character(_l_e_n)      _l_e_n blanks
  60.  
  61.                The _b_o_u_n_d_a_r_y data type must be present for derived data
  62.                types.
  63.  
  64.      _d_i_m       Must be a scalar.  Must be an integer value in the range
  65.                1 <= _d_i_m <= _n, where _n is the rank of _a_r_r_a_y.  If _d_i_m is
  66.                omitted, the default value is 1.
  67.  
  68.      EEOOSSHHIIFFTT is a transformational intrinsic function.  The name of this
  69.      intrinsic cannot be passed as an argument.
  70.  
  71. RREETTUURRNN VVAALLUUEESS
  72.      The result is an array of the same type, type parameters, and shape as
  73.      _a_r_r_a_y.
  74.  
  75.      Element (_s , _s , ..., _s )
  76.                1   2        _n
  77.      of the result has the value
  78.      _a_r_r_a_y(_s , _s , ..., _s     , _s    + _s_h, _s     , ..., _s ),
  79.             1   2        _d_i_m-1   _d_i_m        _d_i_m+1        _n
  80.      where _s_h is _s_h_i_f_t or
  81.      _s_h_i_f_t(_s , _s , ..., _s     , _s     , ..., _s ),
  82.             1   2        _d_i_m-1   _d_i_m+1        _n
  83.      provided that the inequality
  84.      LLBBOOUUNNDD((_a_r_r_a_y,_d_i_m) <= _s    + _s_h <= UUBBOOUUNNDD((_a_r_r_a_y,_d_i_m)
  85.                            _d_i_m
  86.      holds and is otherwise _b_o_u_n_d_a_r_y or
  87.      _b_o_u_n_d_a_r_y(_s , _s , ..., _s     , _s     , ..., _s ).
  88.                1   2        _d_i_m-1   _d_i_m+1        _n
  89.  
  90. EEXXAAMMPPLLEESS
  91.      Example 1:  If VV is an array [[11,, 22,, 33,, 44,, 55,, 66]], the effect of
  92.      shifting VV end-off to the left by three positions is achieved by
  93.      EEOOSSHHIIFFTT((VV,, SSHHIIFFTT == 33)), which has the value [[44,, 55,, 66,, 00,, 00,, 00]].
  94.      Specifying EEOOSSHHIIFFTT((VV,, SSHHIIFFTT == --22,, BBOOUUNNDDAARRYY == 9999)) achieves an end-off
  95.      shift to the right by two positions with the boundary value of 9999 and
  96.      has the value of [[9999,, 9999,, 11,, 22,, 33,, 44]].
  97.  
  98.      Example 2:  The rows of an array of rank two can all be shifted by the
  99.      same amount or by different amounts and the boundary elements can be
  100.      the same or different.  Assume that MM is the following array:
  101.  
  102.         | A B C |
  103.  
  104.         | D E F |
  105.  
  106.         | G H I |
  107.  
  108.      The value of EEOOSSHHIIFFTT((MM,, SSHHIIFFTT ==--11,, BBOOUUNNDDAARRYY == ''**'',, DDIIMM == 22)) is as
  109.      follows:
  110.  
  111.         | * A B |
  112.  
  113.         | * D E |
  114.  
  115.         | * G H |
  116.  
  117.      The value of EEOOSSHHIIFFTT((MM,, SSHHIIFFTT ==((// --11,, 11,, 00 //)),, BBOOUUNNDDAARRYY == ((// ''**'',, ''//'',,
  118.      ''??'' //)),, DDIIMM == 22)) is as follows:
  119.  
  120.         | * A B |
  121.  
  122.         | E F  / |
  123.  
  124.         | G H I |
  125.  
  126.      The value of section EEOOSSHHIIFFTT((MM((22::33,,22::33)),, SSHHIIFFTT == --11,, BBOOUUNNDDAARRYY == ''**'',,
  127.      DDIIMM==22)) is as follows:
  128.  
  129.         | * E |
  130.  
  131.         | * H |
  132.  
  133. SSEEEE AALLSSOO
  134.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  135.      printed version of this man page.
  136.  
  137.